<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	request.setAttribute("basePath",basePath);
%>
<%@ include file="/resources/js/easyui/taglibs.jsp"%>
<%@ include file="/resources/js/wechat/_wechatui.jsp"%>
<%@ include file="/resources/js/easyui/_viewJS.jsp"%>
<!DOCTYPE>
<html>
<head>
	<title>找回密码</title>
</head>
<body>
<div class="loading"></div>

<div class="page login_page">
	<div class="login_inner">
		<div class="zh_title"><em class="wj_tile">忘记密码</em></div>
		<!-- 错误提示 -->
		<div class="loginPoint"></div>
		<div class="lgin_form">
			<div class='lg_zh'><input type="text" autofocus id="username" class="zhaohuimmyhm" placeholder="请输入用户名"></div>
			<%--<div class='lg_ps'><input  id="username"type="text" placeholder="请输入用户名"></div>--%>
			<div class="lg_button zh_fs" style="background:none;">
				<em>请选择找回方式:</em>
				<%--<a id="mobileback" href="JavaScript:;">手机找回</a>--%>
				<input class="lg_btn2" id="mobileback" type="button" value="手机找回">
			</div>
		</div>
	</div>
	<div class="footer_bz">游艺云</div>
</div>
</body>
</html>
<script>
	$(function(){
		//登录
		var regUser=/^\w{5,20}$/;
		var username="";
		$(".page").yanZheng();
		$("#mobileback").on("click", function(){
			username = $("#username").val();
			if(username==null||username==''){
				//alert("用户名不能为空");
				$(".loginPoint").text("用户名不能为空");
			}else if(regUser.test(username)){
				$.ajax({
					url:'${basePath}wechat/login/validUser',
					type : 'POST',
					data : 'username='+username,
					error: function (response) {
						ViewHelper.func.ajaxWechatErrorMessage(response);
					},
					success: function (ret) {
						if(ret.result) {
							window.location = "${basePath}wechat/login/forget?userId="+ret.info;
						}else{
							$(".loginPoint").text(ret.info);
						}
					}
				});
			}
		});

	});

</script>

